﻿namespace NOAH.CMS.Repository
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    public class FilmRepository : Repository<Film>
    {
        public List<Film> GetImageInCategory(int categoryId)
        {
            return (from p in base.dataContext.Films
                where p.CategoryId == categoryId
                select p).ToList<Film>();
        }

        public List<Film> GetImageInHome(int limit)
        {
            List<Film> images = new List<Film>();
            return (from p in base.dataContext.Films
                where (p.ID >= 0) && (p.Ontop == true)
                orderby p.ID descending
                select p).Take<Film>(limit).ToList<Film>();
        }
    }
}

